<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Student certificate location Details</f:facet>

        <s:decorate id="id" template="layout/display.xhtml">
            <ui:define name="label">Id</ui:define>
            <h:outputText value="#{studentCertificateLocationHome.instance.id}"/>
        </s:decorate>

        <s:decorate id="locationUrl" template="layout/display.xhtml">
            <ui:define name="label">Location url</ui:define>
            <h:outputText value="#{studentCertificateLocationHome.instance.locationUrl}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/StudentCertificateLocationEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty studentCertificateLocationFrom ? 'StudentCertificateLocationList' : studentCertificateLocationFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Student</h:panelGroup>
        </f:facet>
    <div class="association" id="studentParent">

        <h:outputText value="There is no student associated with this studentCertificateLocation."
                   rendered="#{studentCertificateLocationHome.instance.student == null}"/>

        <rich:dataTable var="_student"
                   value="#{studentCertificateLocationHome.instance.student}"
                rendered="#{studentCertificateLocationHome.instance.student != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="studentTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_student.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">UserAccount id</f:facet>
                <h:outputText value="#{_student.userAccount.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Course id</f:facet>
                <h:outputText value="#{_student.course.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">First name</f:facet>
                <h:outputText value="#{_student.firstName}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Last name</f:facet>
                <h:outputText value="#{_student.lastName}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Passport photo url</f:facet>
                <h:outputText value="#{_student.passportPhotoUrl}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Date of birth</f:facet>
                <h:outputText value="#{_student.dateOfBirth}">
                    <s:convertDateTime type="date" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Register number</f:facet>
                <h:outputText value="#{_student.registerNumber}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Roll number</f:facet>
                <h:outputText value="#{_student.rollNumber}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewstudent"
                     value="View"
                      view="/Student.xhtml">
                    <f:param name="studentId"
                           value="#{_student.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Student cerficate</h:panelGroup>
        </f:facet>
    <div class="association" id="studentCerficateParent">

        <h:outputText value="There is no studentCerficate associated with this studentCertificateLocation."
                   rendered="#{studentCertificateLocationHome.instance.studentCerficate == null}"/>

        <rich:dataTable var="_studentCerficate"
                   value="#{studentCertificateLocationHome.instance.studentCerficate}"
                rendered="#{studentCertificateLocationHome.instance.studentCerficate != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="studentCerficateTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_studentCerficate.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Student id</f:facet>
                <h:outputText value="#{_studentCerficate.student.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Certificate id</f:facet>
                <h:outputText value="#{_studentCerficate.certificate.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Received status</f:facet>
                <h:outputText value="#{_studentCerficate.receivedStatus}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewstudentCerficate"
                     value="View"
                      view="/StudentCerficate.xhtml">
                    <f:param name="studentCerficateId"
                           value="#{_studentCerficate.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
